import { turnTime } from '../utils/turnTime';

export const columns = (words) => [
    {
        title: '时间',
        dataIndex: 'time',
        key: 'time',
        align: 'center',
        render: (record) => turnTime(record)
    },
    {
        title: '类型',
        dataIndex: 'type',
        key: 'type',
        align: 'center',
        render: (record) => parseInt(record) ? '收入' : '支出'
    },
    {
        title: '分类',
        dataIndex: 'category',
        key: 'category',
        align: 'center',
        render: (record) => words[record] || record
    },
    {
        title: '金额',
        dataIndex: 'amount',
        key: 'amount',
        align: 'center',
    }
];